﻿@model Lead2012.Business.FieldInfo

    @if (Model.TypeId == 1)
    {
        // Text                      
        <div class="row">
            <label for="@Model.Id">@Model.Title</label>
            <div class="groupinput">
                @if (!string.IsNullOrEmpty(Model.Visibility) && Model.Visibility.ToUpper() == "READONLY")
                {
                    <input type="text" value="@Model.Value" class="text readonly" maxlength="100" validation="required text" readonly="readonly" id="@Model.Id" name="@Model.Id" />
                }
                else
                {
                    <input type="text" value="@Model.Value" class="text" maxlength="100" validation="required text" id="@Model.Id" name="@Model.Id" />
                }
                                                        
                @if (!string.IsNullOrEmpty(Model.ToolTip))
                {
                    <span title="@Model.ToolTip" class="info"><em>info</em></span>
                }
            </div>
        </div>
    }
    else if (Model.TypeId == 2)
    {
        // Number                
        <div class="row">
            <label for="@Model.Id">@Model.Title</label>
            <div class="groupinput">
                @if (!string.IsNullOrEmpty(Model.Visibility) && Model.Visibility.ToUpper() == "READONLY")
                {
                    <input type="text" value="@Model.Value" class="text readonly" maxlength="18" validation="required number" readonly="readonly" id="@Model.Id" name="@Model.Id" />
                }
                else
                {
                    <input type="text" value="@Model.Value" class="text" maxlength="18" validation="required number" id="@Model.Id" name="@Model.Id" />
                }
                                                        
                @if (!string.IsNullOrEmpty(Model.ToolTip))
                {
                    <span title="@Model.ToolTip" class="info"><em>info</em></span>
                }
            </div>
        </div>
    }
    else if (Model.TypeId == 4)
    {
        // Money                      
        <div class="row">
            <label for="@Model.Id">@Model.Title</label>
            <div class="groupinput">
                @if (!string.IsNullOrEmpty(Model.Visibility) && Model.Visibility.ToUpper() == "READONLY")
                {
                    <input type="text" value="@Model.Value" class="text readonly" maxlength="18" validation="required money" readonly="readonly" id="@Model.Id" name="@Model.Id" />
                }
                else
                {
                    <input type="text" value="@Model.Value" class="text" maxlength="18" validation="required money" id="@Model.Id" name="@Model.Id" />
                }
                                                        
                @if (!string.IsNullOrEmpty(Model.ToolTip))
                {
                    <span title="@Model.ToolTip" class="info"><em>info</em></span>
                }
            </div>
        </div>
    }
    else if (Model.TypeId == 8)
    {
        // Date                       
        <div class="row">
            <label for="@Model.Id">@Model.Title</label>
            <div class="groupinput">
                @if (!string.IsNullOrEmpty(Model.Visibility) && Model.Visibility.ToUpper() == "READONLY")
                {
                    <input type="text" value="@Model.Value" class="text calendar-date readonly" maxlength="100" validation="required date" readonly="readonly" id="@Model.Id" name="@Model.Id" />
                }
                else
                {
                    <input type="text" value="@Model.Value" class="text calendar-date" maxlength="100" validation="required date" id="@Model.Id" name="@Model.Id" />
                }
                @if (!string.IsNullOrEmpty(Model.ToolTip))
                {
                    <span title="@Model.ToolTip" class="info"><em>info</em></span>
                }
            </div>
        </div>
    }
    else if (Model.TypeId == 8192)
    {
        // Date / Time                    
        <div class="row">
            <label for="@Model.Id">@Model.Title</label>
            <div class="groupinput">
                @if (!string.IsNullOrEmpty(Model.Visibility) && Model.Visibility.ToUpper() == "READONLY")
                {
                    <input type="text" value="@Model.Value" class="text calendar-datetime readonly" maxlength="20" validation="required datetime" readonly="readonly" id="@Model.Id" name="@Model.Id" />
                }
                else
                {
                    <input type="text" value="@Model.Value" class="text calendar-datetime" maxlength="20" validation="required datetime" id="@Model.Id" name="@Model.Id" />
                }
                @if (!string.IsNullOrEmpty(Model.ToolTip))
                {
                    <span title="@Model.ToolTip" class="info"><em>info</em></span>
                }
            </div>
        </div>
    }
    else if (Model.TypeId == 16384)
    {
        // Time                       
        <div class="row">
            <label for="@Model.Id">@Model.Title</label>
            <div class="groupinput">
                @if (!string.IsNullOrEmpty(Model.Visibility) && Model.Visibility.ToUpper() == "READONLY")
                {
                    <input type="text" value="@Model.Value" class="text calendar-time readonly" maxlength="20" validation="required time" readonly="readonly" id="@Model.Id" name="@Model.Id" />
                }
                else
                {
                    <input type="text" value="@Model.Value" class="text calendar-time" maxlength="20" validation="required time" id="@Model.Id" name="@Model.Id" />
                }
                @if (!string.IsNullOrEmpty(Model.ToolTip))
                {
                    <span title="@Model.ToolTip" class="info"><em>info</em></span>
                }
            </div>
        </div>
    }
    else if (Model.TypeId == 16)
    {
        // Phone                       
        <div class="row">
            <label for="@Model.Id">@Model.Title</label>
            <div class="groupinput">
                @if (!string.IsNullOrEmpty(Model.Visibility) && Model.Visibility.ToUpper() == "READONLY")
                {
                    <input type="text" value="@Model.Value" class="text readonly" maxlength="100" validation="required phone" readonly="readonly" id="@Model.Id" name="@Model.Id" />
                }
                else
                {
                    <input type="text" value="@Model.Value" class="text" validation="required phone" maxlength="100" id="@Model.Id" name="@Model.Id" />
                }
                @if (!string.IsNullOrEmpty(Model.ToolTip))
                {
                    <span title="@Model.ToolTip" class="info"><em>info</em></span>
                }
            </div>
        </div>
    }
    else if (Model.TypeId == 128)
    {
        // Zip                       
        <div class="row">
            <label for="@Model.Id">@Model.Title</label>
            <div class="groupinput">
                @if (!string.IsNullOrEmpty(Model.Visibility) && Model.Visibility.ToUpper() == "READONLY")
                {
                    <input type="text" value="@Model.Value" class="text readonly" maxlength="100" validation="required zipcode" readonly="readonly" id="@Model.Id" name="@Model.Id" />
                }
                else
                {
                    <input type="text" value="@Model.Value" class="text" validation="required zipcode" id="@Model.Id" name="@Model.Id" />
                }
                @if (!string.IsNullOrEmpty(Model.ToolTip))
                {
                    <span title="@Model.ToolTip" class="info"><em>info</em></span>
                }
            </div>
        </div>
    }
    else if (Model.TypeId == 256)
    {
        // Long Text                       
        <div class="row">
            <label for="@Model.Id">@Model.Title</label>
            <div class="groupinput">
                @if (!string.IsNullOrEmpty(Model.Visibility) && Model.Visibility.ToUpper() == "READONLY")
                {
                    <textarea type="text" class="text readonly" maxlength="500" validation="required text" readonly="readonly" id="@Model.Id" name="@Model.Id">@Model.Value</textarea>
                }
                else
                {
                    <textarea type="text" class="text" maxlength="500" validation="required text"  id="@Model.Id" name="@Model.Id">@Model.Value</textarea>
                }
                @if (!string.IsNullOrEmpty(Model.ToolTip))
                {
                    <span title="@Model.ToolTip" class="info"><em>info</em></span>
                }
            </div>
        </div>
    }
    else if (Model.TypeId == 2048)
    {
        // Email                       
        <div class="row">
            <label for="@Model.Id">@Model.Title</label>
            <div class="groupinput">
                
                @if (!string.IsNullOrEmpty(Model.Visibility) && Model.Visibility.ToUpper() == "READONLY")
                {
                    <input type="text" value="@Model.Value" class="text readonly" maxlength="100" readonly="readonly" validation="required email" id="@Model.Id" name="@Model.Id" />
                }
                else
                {
                    <input type="text" value="@Model.Value" class="text" maxlength="100" validation="required email" id="@Model.Id" name="@Model.Id" />
                }

                @if (!string.IsNullOrEmpty(Model.ToolTip))
                {
                    <span title="@Model.ToolTip" class="info"><em>info</em></span>
                }
            </div>
        </div>
    }
    else if (Model.TypeId == 4096)
    {
        // ssn                       
        <div class="row">
            <label for="@Model.Id">@Model.Title</label>
            <div class="groupinput">
                @if (!string.IsNullOrEmpty(Model.Visibility) && Model.Visibility.ToUpper() == "READONLY")
                {
                    <input type="text" value="@Model.Value" class="text readonly" maxlength="100" validation="required ssn" readonly="readonly" id="@Model.Id" name="@Model.Id" />
                }
                else
                {
                    <input type="text" value="@Model.Value" class="text" maxlength="100" validation="required ssn" id="@Model.Id" name="@Model.Id" />
                }

                @if (!string.IsNullOrEmpty(Model.ToolTip))
                {
                    <span title="@Model.ToolTip" class="info"><em>info</em></span>
                }
            </div>
        </div>
    }
    else if (Model.TypeId == 32768)
    {
        // Formula                       
        <div class="row">
            <label for="@Model.Id">@Model.Title</label>
            <div class="groupinput">                
                <span>>@Html.Raw(Model.Value)</span>
                @if (!string.IsNullOrEmpty(Model.ToolTip))
                {
                    <span title="@Model.ToolTip" class="info"><em>info</em></span>
                }
            </div>
        </div>
    }
    else
    {
        // All Others                       
        <div class="row">
            <label for="@Model.Id">@Model.Title</label>
            <div class="groupinput">
                @if (!string.IsNullOrEmpty(Model.Visibility) && Model.Visibility.ToUpper() == "READONLY")
                {
                    <input type="text" value="@Model.Value" class="text readonly" maxlength="100" validation="required" readonly="readonly" id="@Model.Id" name="@Model.Id" />
                }
                else
                {
                    <input type="text" value="@Model.Value" class="text" maxlength="100" validation="required" id="@Model.Id" name="@Model.Id" />
                }

                @if (!string.IsNullOrEmpty(Model.ToolTip))
                {
                    <span title="@Model.ToolTip" class="info"><em>info</em></span>
                }
            </div>
        </div>
    }